﻿using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Data;
using ReflectionStudio.Core.Events;
using System.Windows.Controls;
using System.Collections;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public partial class TWB2WH
    {  
        public TWB2WH()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VWBBST();
            this.DataContext = MV; 
            InitializeComponent(); 
        } 

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            if (IsLoaded)
                return;
            base.Window_Loaded(sender, e);
           
        }
        public override void LOADBYAUF()
        { 
            TBMain.Clear();
            SUM1 = 0;
            SUM2 = 0;
            Counts1 = 0;
            Counts2 = 0;
            if (!IsShow)
                return;
            if (ORDERNUM.Length < 20)
                return;
            LIEFSCH = ORDERNUM.Substring(12, 8);
            PM["AUFTYP"] = ORDERNUM.Substring(0, 1);
            PM["KRS"] = ORDERNUM.Substring(1, 2);
            PM["LFD"] = ORDERNUM.Substring(3, 6);
            PM["POS"] = ORDERNUM.Substring(9, 3);
            PM["LIEFSCH"] = ORDERNUM.Substring(12, 8);
            PM["LO"] = SLO;
            PM["LB"] = SLB;
            if (IsVV)
            {
                SResult = TMV.WB2WH(PM);
                MergeData(SResult, true, true);
            }
            else
            {
                TMV.VVTLOAD(PM);
            }
           
            base.LOADBYAUF();
        } 
    }
}
